^tools/xenstore/xenstore-read$
^tools/xenstore/xenstore-rm$
^tools/xenstore/xenstore-write$
-^tools/xenstore/xs_dom0_test$
+^tools/xenstore/xs_crashme$
^tools/xenstore/xs_random$
^tools/xenstore/xs_stress$
^tools/xenstore/xs_tdb_dump$
CLEAN_FILES += include/asm-ia64/.offsets.h.stamp vmlinux.gz bootloader
#CLEAN_FILES += include/asm-xen/xen-public include/asm-ia64/xen/asm-xsi-offsets.h
-#CLEAN_FILES += include/asm-xen/linux-public/xenstored.h
#CLEAN_FILES += include/asm-xen/linux-public include/asm-xen/asm-ia64/hypervisor.h
MRPROPER_FILES += include/asm-ia64/offsets.h
# [ -e include/asm-xen/linux-public ] \
# || ln -s $(XEN_PATH)/linux-2.6-xen-sparse/include/asm-xen/linux-public \
include/asm-xen/linux-public
- [ -e include/asm-xen/linux-public/xenstored.h ] \
- || ln -s $(XEN_PATH)/tools/xenstore/xenstored.h \
- include/asm-xen/linux-public/xenstored.h
[ -e include/asm-xen/asm-ia64/hypervisor.h ] \
|| ln -s $(XEN_PATH)/linux-2.6-xen-sparse/include/asm-xen/asm-ia64/hypervisor.h \
include/asm-xen/asm-ia64/hypervisor.h
#include <asm-xen/xenbus.h>
#include <asm-xen/xen_proc.h>
#include <asm/hypervisor.h>
-#include <asm-xen/linux-public/xenstored.h>
struct xenbus_dev_data {
/* Are there bytes left to be read in this message? */
#include <linux/fcntl.h>
#include <linux/kthread.h>
#include <asm-xen/xenbus.h>
-#include <asm-xen/linux-public/xenstored.h>
#include "xenbus_comms.h"
#define streq(a, b) (strcmp((a), (b)) == 0)
#include <linux/device.h>
#include <linux/notifier.h>
#include <asm/semaphore.h>
-
-/* FIXME there's got to be a better way to get at the XS_WATCH macros */
-#include <asm-xen/linux-public/xenstored.h>
+#include <asm-xen/xen-public/io/xs_wire.h>
/* A xenbus device. */
struct xenbus_device {
cd ${AD}/include/asm-xen/xen-public
relative_lndir ../../../${RS}/../xen/include/public
-cd ${AD}/include/asm-xen/linux-public
-ln -sf ../../../${RS}/../tools/xenstore/xenstored.h
-
# Arch-specific post-processing
cd ${AD}
if [ -x arch/${LINUX_ARCH}/xen-mkbuildtree-post ]; then
if (i % print == 0)
write(1, ".", 1);
- if (!xs_transaction_start(h, "/")) {
+ if (!xs_transaction_start(h)) {
kill_daemon(pid);
barf_perror("Starting transaction");
}
+++ /dev/null
-/*
- * Simple prototyle Xen Store Daemon providing simple tree-like database.
- * Copyright (C) 2005 Rusty Russell IBM Corporation
- *
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this source file (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy, modify,
- * merge, publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef _XENSTORED_H
-#define _XENSTORED_H
-
-enum xsd_sockmsg_type
-{
- XS_DEBUG,
- XS_SHUTDOWN,
- XS_DIRECTORY,
- XS_READ,
- XS_GET_PERMS,
- XS_WATCH,
- XS_WATCH_ACK,
- XS_UNWATCH,
- XS_TRANSACTION_START,
- XS_TRANSACTION_END,
- XS_OP_READ_ONLY = XS_TRANSACTION_END,
- XS_INTRODUCE,
- XS_RELEASE,
- XS_GET_DOMAIN_PATH,
- XS_WRITE,
- XS_MKDIR,
- XS_RM,
- XS_SET_PERMS,
- XS_WATCH_EVENT,
- XS_ERROR,
-};
-
-#define XS_WRITE_NONE "NONE"
-#define XS_WRITE_CREATE "CREATE"
-#define XS_WRITE_CREATE_EXCL "CREATE|EXCL"
-
-/* We hand errors as strings, for portability. */
-struct xsd_errors
-{
- int errnum;
- const char *errstring;
-};
-#define XSD_ERROR(x) { x, #x }
-static struct xsd_errors xsd_errors[] __attribute__((unused)) = {
- XSD_ERROR(EINVAL),
- XSD_ERROR(EACCES),
- XSD_ERROR(EEXIST),
- XSD_ERROR(EISDIR),
- XSD_ERROR(ENOENT),
- XSD_ERROR(ENOMEM),
- XSD_ERROR(ENOSPC),
- XSD_ERROR(EIO),
- XSD_ERROR(ENOTEMPTY),
- XSD_ERROR(ENOSYS),
- XSD_ERROR(EROFS),
- XSD_ERROR(EBUSY),
- XSD_ERROR(EAGAIN),
- XSD_ERROR(EISCONN),
-};
-struct xsd_sockmsg
-{
- u32 type;
- u32 len; /* Length of data following this. */
-
- /* Generally followed by nul-terminated string(s). */
-};
-
-/* FIXME we shouldn't have to declare this in two places, what's the right
- way to share things between xenstored.h and xs.h? */
-enum xs_watch_type
-{
- XS_WATCH_PATH = 0,
- XS_WATCH_TOKEN,
-};
-
-#endif /* _XENSTORED_H */
#include "list.h"
#include "talloc.h"
#include "xs_lib.h"
-#include "xenstored.h"
#include "xenstored_core.h"
#include "xenstored_watch.h"
#include "xenstored_transaction.h"
#include <stdint.h>
#include <errno.h>
#include "xs_lib.h"
-#include "xenstored.h"
#include "list.h"
#include "tdb.h"
#include <errno.h>
#include <sys/ioctl.h>
#include "xs.h"
-#include "xenstored.h"
-#include "xs_lib.h"
#include "utils.h"
struct xs_handle
#ifndef _XS_H
#define _XS_H
-#include "xs_lib.h"
+#include <xs_lib.h>
struct xs_handle;
-/* FIXME we shouldn't have to declare this in two places, what's the right
- way to share things between xenstored.h and xs.h? */
-enum xs_watch_type
-{
- XS_WATCH_PATH = 0,
- XS_WATCH_TOKEN,
-};
-
/* On failure, these routines set errno. */
/* Connect to the xs daemon.
#include "xs.h"
#include "talloc.h"
#include <errno.h>
-#include "xenstored.h"
#define XSTEST
#define RAND_FREQ 128 /* One char in 32 is corrupted. */
return ret;
}
-static int random_flags(int *state)
-{
- switch (get_randomness(state) % 4) {
- case 0:
- return 0;
- case 1:
- return O_CREAT;
- case 2:
- return O_CREAT|O_EXCL;
- default:
- return get_randomness(state);
- }
-}
-
/* Do the next operation, return the results. */
static void do_next_op(struct xs_handle *h, bool verbose)
{
case 7: {
if (verbose)
printf("START %s\n", name);
- xs_transaction_start(h, name);
+ xs_transaction_start(h);
break;
}
case 8: {
#include <stdbool.h>
#include <limits.h>
#include <xenctrl.h>
+#include <errno.h>
+#include <xen/io/xs_wire.h>
/* Bitmask of permissions. */
enum xs_perm_type {
--- /dev/null
+/*
+ * Details of the "wire" protocol between Xen Store Daemon and client
+ * library or guest kernel.
+ * Copyright (C) 2005 Rusty Russell IBM Corporation
+ *
+ * This file may be distributed separately from the Linux kernel, or
+ * incorporated into other software packages, subject to the following license:
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef _XS_WIRE_H
+#define _XS_WIRE_H
+
+enum xsd_sockmsg_type
+{
+ XS_DEBUG,
+ XS_SHUTDOWN,
+ XS_DIRECTORY,
+ XS_READ,
+ XS_GET_PERMS,
+ XS_WATCH,
+ XS_WATCH_ACK,
+ XS_UNWATCH,
+ XS_TRANSACTION_START,
+ XS_TRANSACTION_END,
+ XS_OP_READ_ONLY = XS_TRANSACTION_END,
+ XS_INTRODUCE,
+ XS_RELEASE,
+ XS_GET_DOMAIN_PATH,
+ XS_WRITE,
+ XS_MKDIR,
+ XS_RM,
+ XS_SET_PERMS,
+ XS_WATCH_EVENT,
+ XS_ERROR,
+};
+
+#define XS_WRITE_NONE "NONE"
+#define XS_WRITE_CREATE "CREATE"
+#define XS_WRITE_CREATE_EXCL "CREATE|EXCL"
+
+/* We hand errors as strings, for portability. */
+struct xsd_errors
+{
+ int errnum;
+ const char *errstring;
+};
+#define XSD_ERROR(x) { x, #x }
+static struct xsd_errors xsd_errors[] __attribute__((unused)) = {
+ XSD_ERROR(EINVAL),
+ XSD_ERROR(EACCES),
+ XSD_ERROR(EEXIST),
+ XSD_ERROR(EISDIR),
+ XSD_ERROR(ENOENT),
+ XSD_ERROR(ENOMEM),
+ XSD_ERROR(ENOSPC),
+ XSD_ERROR(EIO),
+ XSD_ERROR(ENOTEMPTY),
+ XSD_ERROR(ENOSYS),
+ XSD_ERROR(EROFS),
+ XSD_ERROR(EBUSY),
+ XSD_ERROR(EAGAIN),
+ XSD_ERROR(EISCONN),
+};
+struct xsd_sockmsg
+{
+ u32 type;
+ u32 len; /* Length of data following this. */
+
+ /* Generally followed by nul-terminated string(s). */
+};
+
+enum xs_watch_type
+{
+ XS_WATCH_PATH = 0,
+ XS_WATCH_TOKEN,
+};
+
+#endif /* _XS_WIRE_H */